package View.Beat;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JFrame;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class CircleBar extends JPanel implements Runnable {
	Thread thread;
	JFrame frame;

	int y=0;
	public CircleBar()
	{
		thread = new Thread(this);
		thread.start();
	}
	@Override
	public void paint(Graphics g) {

		super.paint(g);
		Graphics2D g2d = (Graphics2D) g;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.fillArc(0, 0, 150, 150, 180, y);
	}
	public void setValue(int val)
	{
		y= y + val;
	}
	
	@Override
	public void run() {

		for(;;)
		{
			
			y=-Math.abs((int)(y*0.90));
			//Im.repaint();
			this.repaint();
			try {
				Thread.sleep(50);
			} catch (Exception e) {};
		}
	}
}